from selenium import webdriver
from selenium.webdriver import ActionChains
from time import  sleep

bro = webdriver.Chrome(executable_path='./chromedriver.exe')

#让浏览器发起一个指定url对应请求
bro.get('http://qzone.qq.com')

bro.switch_to.frame('login_frame')
a_tag = bro.find_element_by_id('switcher_plogin')
a_tag.click()

Username = bro.find_element_by_id('u')
Password = bro.find_element_by_id('p')
sleep(1)
Username.send_keys('123')
sleep(1)
Password.send_keys('123')
sleep(1)
Login = bro.find_element_by_id('login_button')
Login.click()

sleep(3)

bro.quit()